{extend name="base" /}
{block name="css"}
<style>
#preview img{
  max-width: 600px;
  max-height:150px;
}
</style>
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/webuploader/webuploader.css?v={$v}" />
{/block}
{block name="js"}
<script type='text/javascript' src='__STATIC__/plugins/webuploader/webuploader.js?v={$v}'></script>
<script src="__ADMIN__/ads/ads.js?v={$v}" type="text/javascript"></script>
{/block}
{block name="main"}
<div class="l-loading" style="display: block" id="wst-loading"></div>
<form id="adsForm">
<table class='wst-form wst-box-top'>
  <tr>
      <th width='150'>位置类型<font color='red'>*</font>：</th>
          <td>
            <select id="positionType" name="positionType" class='ipt' maxLength='20' onchange="addPosition(this.value)">
              <option value="-1">-请选择-</option>
              <option <?=($data['positionType']===1)?'selected':'';?> value="1">PC版</option>
            </select>
          </td>
       </tr>
       <tr>
          <th>广告位置<font color='red'>*</font>：</th>
          <td>
            <select id="adPositionId" name="adPositionId" class='ipt' maxLength='20' onchange="getPhotoSize(this.value)">
              <option value="">-请选择-</option>
            </select>
          </td>
       </tr>
       <tr>
          <th>广告标题<font color='red'>*</font>：</th>
          <td><input type='text' id='adName' name="adName" value='{$data['adName']}' class='ipt' maxLength='20'/></td>
       </tr>
       <tr>
          <th>广告图片<font color='red'>*</font>：</th>
          <td><div id='adFilePicker'>上传广告图</div><span id='uploadMsg'></span>
              <div>
                图片大小:<span id="img_size">300x300</span>(px)，格式为 gif, jpg, jpeg, png
              </div>
          </td>

       </tr>
       <tr>
          <th>预览图<font color='red'>  </font>：</th>
          <td>
            <div id="preview" style="min-height:30px;">
              {if ($data['adFile']!='')}
              <img src="__ROOT__/{$data['adFile']}">
              {/if}
            </div>
            <input type="hidden" name="adFile" id="adFile" class="ipt" value="{$data['adFile']}" />
          </td>


       </tr>
       <tr>
          <th>广告网址<font color='red'>  </font>：</th>
          <td>
            <input type="text" id="adURL" class="ipt" maxLength="20" value='{$data['adURL']}' />
          </td>
       </tr>
       <tr>
          <th >广告开始时间<font color='red'>*</font>：</th>
          <td>
            <input type="text" style="margin:0px;vertical-align:baseline;" id="adStartDate" name="adStartDate" class="ipt" maxLength="20"  />
          </td>
       </tr>
       <tr>
          <th>广告结束时间<font color='red'>*</font>：</th>
          <td>
            <input type="text" style="margin:0px;vertical-align:baseline;" id="adEndDate" name="adEndDate" class="ipt" maxLength="20" value='{$data['adEndDate']}' />
          </td>
       </tr>
       <tr>
          <th>广告排序号：</th>
          <td>
            <input type="text" id="adSort" class="ipt" maxLength="20"  value='{$data['adSort']}' />
          </td>
       </tr>
  
  <tr>
     <td colspan='2' align='center'>
       <input type="hidden" name="id" id="adId" class="ipt" value="{$data['adId']+0}" />
       <input type="submit" value="提交" class='btn btn-blue' />
       <input type="button" onclick="javascript:history.go(-1)" class='btn' value="返回" />
     </td>
  </tr>
</table>
</form>
<script>
$(function(){
editInit();
//初始化位置类型
if("{$data['positionType']}" == '1')addPosition("{$data['positionType']}","{$data['adPositionId']}");
//时间插件
$("#adStartDate").ligerDateEditor().setValue('{$data['adStartDate']}');
$("#adEndDate").ligerDateEditor().setValue('{$data['adEndDate']}');
});

</script>
{/block}

